--- /dev/null
+Date: Sun, 3 Aug 2025 08:48:40 +0200
+Subject: batctl: event: Fix direct parsing on hardif for set_hardif
+
+The code to get the hard interface name for an even was accidentally
+checking for BATADV_ATTR_MESH_IFNAME instead of BATADV_ATTR_HARD_IFNAME. As
+result, the fallback code was always used when BATADV_ATTR_MESH_IFNAME
+would have not been available.
+
+Luckily, at the moment, BATADV_ATTR_HARD_IFNAME is always available when
+BATADV_ATTR_MESH_IFNAME is set BATADV_CMD_SET_HARDIF events.
+
+Fixes: d12322eeb361 ("batctl: event: Get ifname from netlink message")
+Origin: upstream, https://git.open-mesh.org/batctl.git/commit/?id=03288f4f3060591dbc33600b4e5f6371d6a9f4ff
+
+--- a/event.c
++++ b/event.c
+@@ -320,7 +320,7 @@ static void event_parse_set_hardif(struc
+ return;
+ }
+
+- if (attrs[BATADV_ATTR_MESH_IFNAME]) {
++ if (attrs[BATADV_ATTR_HARD_IFNAME]) {
+ hardif_name = nla_get_string(attrs[BATADV_ATTR_HARD_IFNAME]);
+ } else {
+ /* compatibility for Linux < 5.14/batman-adv < 2021.2 */
--- /dev/null
+Date: Sun, 3 Aug 2025 08:49:12 +0200
+Subject: batctl: Avoid memory leak in print_routing_algos
+
+The opts.remaining_header string is alocated before the netlink callback
+object is created. But the callback object allocation can fail and the
+function will return in this case. To fix this, either the string buffer
+must be freed in this case or the opts.remaining_header allocation can
+simply be moved to a later point.
+
+Fixes: 0a14f8800dac ("batctl: Handle nl_cb_alloc errors")
+Origin: upstream, https://git.open-mesh.org/batctl.git/commit/?id=9363370cee11af3687ebef028f7c4518107ea424
+
+--- a/routing_algo.c
++++ b/routing_algo.c
+@@ -96,12 +96,12 @@ static int print_routing_algos(struct st
+ nl_send_auto_complete(state->sock, msg);
+ nlmsg_free(msg);
+
+- opts.remaining_header = strdup("Available routing algorithms:\n");
+-
+ cb = nl_cb_alloc(NL_CB_DEFAULT);
+ if (!cb)
+ return -ENOMEM;
+
++ opts.remaining_header = strdup("Available routing algorithms:\n");
++
+ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, netlink_print_common_cb,
+ &opts);
+ nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, netlink_stop_callback, NULL);